<?php

/**
 * JingYao-backend
 *
 * @link     https://gitee.com/wang-zhihui-release/jingyao-backend
 * @apiDocument https://gitee.com/wang-zhihui-release/jingyao-backend/wikis/
 */

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateHousesTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('houses', function (Blueprint $table) {
            $table->id();
            $table->integer('houser_user_id')->default(0)->comment('房东用户 id');
            $table->string('address')->nullable();
            $table->string('size')->nullable();
            $table->tinyInteger('lease_mode')->default(0)->comment('1 整租 2 合租');
            $table->tinyInteger('specs')->default(0)->comment('规格 1 单室 2 双室 3 三室及以上');
            $table->tinyInteger('trade_mode')->default(0)->comment('1 日租 2 月租 3 季租 4 半年租 5 年租及以上');
            $table->tinyInteger('price_range')->default(0)->comment('1 1000 以下 2 1000-1500 ... 8 4000 以上');
            $table->tinyInteger('lease_status')->default(0)->comment('1 待出租 2 已出租');
            $table->string('remarks')->nullable()->comment('备注');
            $table->text('images');
            $table->tinyInteger('check_status')->default(0);
            $table->string('check_message')->nullable()->comment('审核信息');
            $table->index('houser_user_id');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('houses');
    }
}
